package battle.map
{
	import flash.display.BitmapData;
	import flash.utils.Dictionary;

	public class Tileset
	{
		
		protected static var tilesets:Dictionary = new Dictionary() ;
		
		
		public var id:String;
		public var bitmapData:BitmapData;
		
		
		public function Tileset()
		{
		}
		
		public static function getTilesetBitmap( tilesetID:String ):BitmapData
		{	
			if( tilesets[ tilesetID ] )
			{
				return BitmapData( Tileset( tilesets[tilesetID] ).bitmapData );
			}
			
			return null;
			
		} 
		 
		public static function addTileset( tilesetID:String, bitmapData:BitmapData ):void
		{
			
			var tileset:Tileset = new Tileset();
			
			tileset.id = tilesetID;
			
			tileset.bitmapData = bitmapData;
			
			tilesets[ tilesetID ] = tileset;
		}
		
	}
}